home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 February / PCWorld_2007-02_cd.bin / v cisle / Addons / Addons.exe / videodownloader-1.1.1-fx.xpi / chrome / videodownloader.jar / content / options.js < prev    next >
Text File  |  2006-08-24  |  2KB  |  64 lines

  1. /*
  2.  * Version: Open Software License v. 2.1
  3.  *
  4.  * The contents of this file are subject to the Open Software License Version
  5.  * 2.1 (the "License"); you may not use this file except in compliance with
  6.  * the License. You may obtain a copy of the License at
  7.  * http://www.opensource.org/licenses/osl-2.1.php
  8.  *
  9.  * Software distributed under the License is distributed on an "AS IS" basis,
  10.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11.  * for the specific language governing rights and limitations under the
  12.  * License.
  13.  *
  14.  * The Original Code is the VideoDownloader.
  15.  *
  16.  * The Initial Developer of the Original Code is
  17.  * Javi Moya
  18.  *
  19.  * Portions created by the Initial Developer are Copyright (C) 2006
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  * */
  24.  
  25. function getBoolPref(prefName, defval) {
  26.       var result = defval;
  27.       var prefservice = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
  28.       var prefs = prefservice.getBranch("");
  29.  
  30.       if (prefs.getPrefType(prefName) == prefs.PREF_BOOL)
  31.       {
  32.           result = prefs.getBoolPref(prefName);
  33.       }
  34.       return(result);
  35.  
  36.  
  37. function hSubmenusOptSet () {
  38.     var win = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser");
  39.     var showicon = document.getElementById('checkboolpref').checked;
  40.     var icon = win.document.getElementById('videodownloader-statusbar-panel');
  41.     /*var icon = (window.arguments ? window.arguments[0] : null); */ //get statusbar-icon handle
  42.       
  43.     if (icon) 
  44.     {  
  45.                 if (icon && showicon) 
  46.                 {
  47.                  icon.removeAttribute("hidden");
  48.                 }
  49.                 else
  50.                 {
  51.                  icon.setAttribute("hidden", true);
  52.                 }
  53.             }
  54. }
  55.  
  56. window.addEventListener("load", videodownloaderInitListener, false);
  57.  
  58. function videodownloaderInitListener(e) {
  59.     
  60.     var icon = document.getElementById('checkboolpref');
  61.     icon.focus();
  62. }
  63.